<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
session_start();
$UserID = $_SESSION['ID'];
$UserName = $_SESSION['UserName'];
include_once('Mysql_connect.inc');//启动连接，连接名：$conn

$result = mysqli_query($conn, "SELECT
member.sa_id,
studentassociation.title,
studentassociation.description,
studentassociation.president_name,
membergroup.groups
FROM
member ,
studentassociation ,
membergroup
WHERE
member.member_id =  '$UserID' AND
member.groups =  membergroup.id");
while (($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) != NULL){
    echo '<tr>';
    echo '<td>' . $row['sa_id'] . '</td>';
    echo '<td>' . $row['title'] . '</td>';
    echo '<td>' . $row['description'] . '</td>';
    echo '<td>' . $row['president_name'] . '</td>';
    echo '<td>' . $row['groups'] . '</td>';
    echo '</tr>';
}

include_once('Mysql_unconnect.inc'); //断开连接
?>
